namespace Sundry.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddCategory : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Brands",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(maxLength: 30),
                        Logo = c.String(maxLength: 130),
                        Intro = c.String(maxLength: 100),
                        OrderNum = c.Int(nullable: false),
                        IsShow = c.Int(nullable: false),
                        IsRec = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Categories",
                c => new
                    {
                        CategoryId = c.Int(nullable: false, identity: true),
                        ParentId = c.Int(nullable: false),
                        Level = c.Int(nullable: false),
                        Name = c.String(maxLength: 100),
                        CategoryImg = c.String(maxLength: 130),
                        Intro = c.String(maxLength: 100),
                        OrderNum = c.Int(nullable: false),
                        IsShow = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.CategoryId);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.Categories");
            DropTable("dbo.Brands");
        }
    }
}
